/*
using MyGeneration/Template/NHibernate (c) by Sharp 1.4
based on OHM (alvy77@hotmail.com)
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace DomainModel
{

	/// <summary>
	/// ILibraryBookIndent interface for NHibernate mapped table 'LibraryBookIndent'.
	/// </summary>
	public interface ILibraryBookIndent
	{
		#region Public Properties
		
		int lbi_id
		{
			get ;
			set ;
			  
		}
		
		int lbi_uid
		{
			get ;
			set ;
			  
		}
		
		byte lbi_state
		{
			get ;
			set ;
			  
		}
		
		DateTime lbi_time
		{
			get ;
			set ;
			  
		}
		
		string lbi_ip
		{
			get ;
			set ;
			  
		}
		
		int lbi_ucid
		{
			get ;
			set ;
			  
		}
		
		bool IsDeleted { get; set; }
		bool IsChanged { get; set; }
		
		#endregion 
	}

	/// <summary>
	/// LibraryBookIndent object for NHibernate mapped table 'LibraryBookIndent'.
	/// </summary>
	[Serializable]
	public class LibraryBookIndent : ICloneable,ILibraryBookIndent
	{
		#region Member Variables

		protected int _lbi_id;
		protected int _lbi_uid;
		protected byte _lbi_state;
		protected DateTime _lbi_time;
		protected string _lbi_ip;
		protected int _lbi_ucid;
		protected bool _bIsDeleted;
		protected bool _bIsChanged;
		#endregion
		
		#region Constructors
		public LibraryBookIndent() {}
		
		public LibraryBookIndent(int plbiuid, byte plbistate, DateTime plbitime, string plbiip, int plbiucid)
		{
			this._lbi_uid = plbiuid; 
			this._lbi_state = plbistate; 
			this._lbi_time = plbitime; 
			this._lbi_ip = plbiip; 
			this._lbi_ucid = plbiucid; 
		}
		
		public LibraryBookIndent(int plbiid)
		{
			this._lbi_id = plbiid; 
		}
		
		#endregion
		
		#region Public Properties
		
		public virtual int lbi_id
		{
			get { return _lbi_id; }
			set { _bIsChanged |= (_lbi_id != value); _lbi_id = value; }
			
		}
		
		public virtual int lbi_uid
		{
			get { return _lbi_uid; }
			set { _bIsChanged |= (_lbi_uid != value); _lbi_uid = value; }
			
		}
		
		public virtual byte lbi_state
		{
			get { return _lbi_state; }
			set { _bIsChanged |= (_lbi_state != value); _lbi_state = value; }
			
		}
		
		public virtual DateTime lbi_time
		{
			get { return _lbi_time; }
			set { _bIsChanged |= (_lbi_time != value); _lbi_time = value; }
			
		}
		
		public virtual string lbi_ip
		{
			get { return _lbi_ip; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("lbi_ip", "lbi_ip value, cannot contain more than 20 characters");
			  _bIsChanged |= (_lbi_ip != value); 
			  _lbi_ip = value; 
			}
			
		}
		
		public virtual int lbi_ucid
		{
			get { return _lbi_ucid; }
			set { _bIsChanged |= (_lbi_ucid != value); _lbi_ucid = value; }
			
		}
		

		public virtual bool IsDeleted
		{
			get
			{
				return _bIsDeleted;
			}
			set
			{
				_bIsDeleted = value;
			}
		}
		
		public virtual bool IsChanged
		{
			get
			{
				return _bIsChanged;
			}
			set
			{
				_bIsChanged = value;
			}
		}
		
		#endregion 
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			LibraryBookIndent castObj = null;
			try
			{
				castObj = (LibraryBookIndent)obj;
			} catch(Exception) { return false; } 
			return ( castObj != null ) &&
				( this._lbi_id == castObj.lbi_id );
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
		  
			
			int hash = 57; 
			hash = 27 * hash * _lbi_id.GetHashCode();
			return hash; 
		}
		#endregion
		
		#region ICloneable methods
		
		public virtual object Clone()
		{
			return this.MemberwiseClone();
		}
		
		#endregion
	}
	
	#region Custom ICollection interface for LibraryBookIndent 

	
	public interface ILibraryBookIndentCollection : ICollection
	{
		LibraryBookIndent this[int index]{	get; set; }
		void Add(LibraryBookIndent pLibraryBookIndent);
		void Clear();
	}
	
	[Serializable]
	public class LibraryBookIndentCollection : ILibraryBookIndentCollection
	{
		private IList<LibraryBookIndent> _arrayInternal;

		public LibraryBookIndentCollection()
		{
			_arrayInternal = new List<LibraryBookIndent>();
		}
		
		public LibraryBookIndentCollection( IList<LibraryBookIndent> pSource )
		{
			_arrayInternal = pSource;
			if(_arrayInternal == null)
			{
				_arrayInternal = new List<LibraryBookIndent>();
			}
		}

		public LibraryBookIndent this[int index]
		{
			get
			{
				return _arrayInternal[index];
			}
			set
			{
				_arrayInternal[index] = value;
			}
		}

		public int Count { get { return _arrayInternal.Count; } }
		public bool IsSynchronized { get { return false; } }
		public object SyncRoot { get { return _arrayInternal; } }
		public void CopyTo(Array array, int index){ _arrayInternal.CopyTo((LibraryBookIndent[])array, index); }
		public IEnumerator GetEnumerator() { return _arrayInternal.GetEnumerator(); }
		public void Add(LibraryBookIndent pLibraryBookIndent) { _arrayInternal.Add(pLibraryBookIndent); }
		public void Clear() { _arrayInternal.Clear(); }
		public IList<LibraryBookIndent> GetList() { return _arrayInternal; }
	 }
	
	#endregion
}
